//求职者的请求封装
import request from "@/utils/http.ts"

//1.查询求职者个人信息
export const queryJobseekerPersonalAPI = (jobseekerId: string) => {
    return request({
        url: 'jobseeker/queryJobseekerPersonal',
        method: 'post',
        params: {
            jobseekerId: jobseekerId,
        }
    })
}
//2.更新求职者个人信息
export const updateJobseekerPersonalAPI = (data: any) => {
    return request({
        url: 'jobseeker/updateJobseekerPersonal',
        method: 'post',
        data: {
            jobseekerId: data.jobseekerId,
            jobseekerUsername: data.jobseekerUsername,
            jobseekerPhone: data.jobseekerPhone,
            jobseekerName: data.jobseekerName,
            jobseekerGender: data.jobseekerGender,
            jobseekerBirthdate: data.jobseekerBirthdate,
            jobseekerEducationLevel: data.jobseekerEducationLevel,
            jobseekerMajor: data.jobseekerMajor,
            userAvatarUrl: data.userAvatarUrl,//头像
        }
    })
}
//3.查询求职者信息根据ID
export const getJobseekerDetailByJobseekerIdAPI = (jobseekerId: string) => {
    return request({
        url: 'jobseeker/getJobseekerDetailByJobseekerId',
        method: 'post',
        params: {
            jobseekerId: jobseekerId,
        }
    })
}
//4.管理员修改求职者状态
export const updateJobseekerStatusAPI = (data: any) => {
    return request({
        url: 'jobseeker/updateJobseekerStatus',
        method: 'post',
        params: {
            jobseekerId: data.jobseekerId,
            jobseekerStatus: data.jobseekerStatus,
        }
    })
}
//5.管理员-分页获取求职者信息
export const getJobseekerAdminPageAPI = (data: any) => {
    return request({
        url: 'jobseeker/getJobseekerAdminPage',
        method: 'post',
        data: {
            pageCurrent: data.pageCurrent,
            pageSize: data.pageSize,
            searchName: data.searchName,
            jobseekerStatus: data.jobseekerStatus,
            jobseekerIsVerified: data.jobseekerIsVerified,
            jobseekerEducationLevel: data.jobseekerEducationLevel,
        }
    })
}
//6.管理员-修改学生认证状态
export const updateJobseekerVerifiedAPI = (data: any) => {
    return request({
        url: 'jobseeker/updateJobseekerVerified',
        method: 'post',
        params: {
            jobseekerId: data.jobseekerId,
            jobseekerIsVerified: data.jobseekerIsVerified,
        }
    })
}
